Skip to content

Support HealtchCheck on tcp layer,avoid to produce needless http access log#46

Open
shi7161979 wants to merge 7 commits into
openresty:masterfrom
shi7161979:master
Open

Support HealtchCheck on tcp layer,avoid to produce needless http access log#46
shi7161979 wants to merge 7 commits into
openresty:masterfrom
shi7161979:master

Conversation

@shi7161979

Copy link
Copy Markdown

local ok, err = hc.spawn_checker{
shm = "healthcheck", -- defined by "lua_shared_dict"
upstream = "foo.com", -- defined by "upstream"
type = "tcp",
interval = 2000, -- run the check cycle every 2 sec
timeout = 1000, -- 1 sec is the timeout for network operations
fall = 3, -- # of successive failures before turning a peer down
rise = 2, -- # of successive successes before turning a peer up
concurrency = 10, -- concurrency level for test requests
}

end

if typ ~= "http" then
if typ ~= "http" and typ ~= "tcp" then

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ran into this while browsing: updating this check also requires updating the error message below

@shi7161979

Copy link
Copy Markdown
Author

update error message ,thank you for your suggestion, Tieske。

@Colstuwjx

Copy link
Copy Markdown

why we don't merge this? @Tieske

@Tieske

Tieske commented Jun 11, 2019

Copy link
Copy Markdown
Contributor

@Colstuwjx I commented on it, but I'm not a maintainer of this lib

@timebug

timebug commented Sep 27, 2020

Copy link
Copy Markdown

+1 ping @thibaultcha @spacewander

@emirmo

emirmo commented Jun 8, 2024

Copy link
Copy Markdown

Is there a reason this PR was never merged?

@spacewander spacewander left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

end
return peer_fail(ctx, is_backup, id, peer)
else
if ctx.type == "tcp" then

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend to move the if block a level out, so the close & return inside it is more explicitly. Like if not ok ... end; if ctx.type == ....

@spacewander

Copy link
Copy Markdown
Member

Is there a reason this PR was never merged?

Maybe I just missed it in a lot of notifications... Feel free to ping me again!

@mmkhmmkh

Copy link
Copy Markdown

Could anyone merge this MR? @spacewander @shi7161979

@spacewander

Copy link
Copy Markdown
Member

Could anyone merge this MR? @spacewander @shi7161979

The author doesn't adjust the comment in #46 (review). We need test for new feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants